package info.ask4research.web.dto;

import info.ask4research.model.roles.Role;

import java.util.List;

public class RoleDTO {

	private String text;
	private String id;
	private boolean leaf;
	private String cls;
	private String iconCls = "learner.gif";
	
	public RoleDTO(){
	}
	
	public RoleDTO(String text, String id, boolean leaf, String cls){
		this.text = text;
		this.id = id;
		this.leaf = leaf;
		this.cls = cls;
	}
	
	public RoleDTO(Role role){
		
		this.text = role.getText();
		this.leaf = role.isLeaf();
		this.cls = "file";
			if(role.isStaffRole()){
				this.id = "Roles/Staff/"+role.getText();
				this.iconCls = "staff";
			}else{
				this.id = "Roles/Learner/"+role.getText();	
				this.iconCls = "learner";
			}
	}
	
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public boolean isLeaf() {
		return leaf;
	}
	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}
	public String getCls() {
		return cls;
	}
	public void setCls(String cls) {
		this.cls = cls;
	}
	//"cls":"folder","id":"root/learnerLeaf/cewcwefc","leaf":true,"text":"cewcwefc"
	//"text":"Controller.js","id":"src\/app\/Controller.js","leaf":true,"cls":"file"

	public String getIconCls() {
		return iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
}
